package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/teacher/apis"
)

func init() {
	routerCheckRole = append(routerCheckRole, registerOrderCheckRoleRouter)
}

func registerOrderCheckRoleRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	v1 = v1.Group("order")
	v1.Use(authMiddleware.MiddlewareFunc())
	order := apis.Order{}
	// 订单列表
	v1.GET("getOrderList", order.GetOrderList)
	// 订单详情
	v1.GET(":id", order.Detail)
	// 跟进已付款订单
	v1.POST("followPaidOrder", order.FollowPaidOrder)
	// 跟进未付款订单
	v1.POST("followUnpaidOrder", order.FollowUnpaidOrder)
	v1.POST("uploadContract", order.UploadContract)
	v1.POST("uploadBase64", order.UploadBase64)
	// 更改合同
	v1.POST("updateContract", order.UpdateContract)
	//获取制作合同模板页面
	v1.POST("getCreateTemplateUrl", order.GetCreateTemplateUrl)
	//查询合同模板中控件详情
	v1.GET("getTemplateDetail", order.GetTemplateDetail)
	//填写模板生成文件
	v1.POST("fillTemplate", order.FillTemplate)
	// 绑定生成的合同的文件id到线下订单
	v1.POST("bindFileId", order.BindFileId)
}
